<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button id="openBtn">打开新的窗口</button>
<button id="closeBtn"> 关闭打开的窗口</button>
<script>
var btn = document.getElementById("openBtn");
var btn2 = document.getElementById("closeBtn");
var w;
btn.onclick = function (){
    w = window.open("03_获取浏览器的宽高.html", "",
        "width=400,height=400,left=200,top=400,location=0");
}

btn2.onclick = function (){
    w.close();
}

</script>
</body>
</html>